<template>
    <el-dialog v-model="dialogFormVisible" title="项目信息" width="500">
        <el-form :model="form">
            <el-form-item label="项目Git名称" :label-width="formLabelWidth">
                <el-input v-model="form.project_name" autocomplete="off"  readonly />
            </el-form-item>

            <el-form-item label="项目Git地址" :label-width="formLabelWidth">
                <el-input v-model="form.project_address" autocomplete="off" readonly />
            </el-form-item>
        </el-form>
    </el-dialog>
</template>

<script lang="ts" setup>
import { reactive, ref } from 'vue'

const dialogFormVisible = ref(false)
const formLabelWidth = '140px'

const form = reactive({
    project_name: '',
    project_address: '',
})


// 提供一个方法来控制对话框的显示，并接收 teamId
const openDialog = (data) => {
    dialogFormVisible.value = true;
    form.project_name = data.project.name // 将团队名称传递给表单
    form.project_address = data.project.git_address // 将团队的webhook地址传递给表单
};


// 定义一个事件来暴露 openDialog 方法
defineExpose({
    openDialog
})
</script>